package com.kingdee.eas.minghua.finance.app;

import org.apache.log4j.Logger;
import com.kingdee.bos.*;

import java.lang.String;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.eas.minghua.finance.UnProjectCosFactory;
import com.kingdee.eas.minghua.finance.UnProjectCosInfo;
import com.kingdee.eas.minghua.jczlwh.mj.SfshEnum;

public class UnProjectCosControllerBean extends AbstractUnProjectCosControllerBean
{
    private static Logger logger =
        Logger.getLogger("com.kingdee.eas.minghua.finance.app.UnProjectCosControllerBean");
    
	protected boolean _Audit(Context ctx, String Audit) throws BOSException {
		try {
			UnProjectCosInfo Clc = UnProjectCosFactory.getLocalInstance(ctx).getUnProjectCosInfo(new ObjectUuidPK(Audit));
			if(Clc.getDjstage().equals(SfshEnum.shenhez)){
			Clc.setAuditor(SysContext.getSysContext().getCurrentUserInfo());
			Clc.setDjstage(SfshEnum.yes);
			SelectorItemCollection sel = new SelectorItemCollection();
		    sel.add("djstage");
		    UnProjectCosFactory.getLocalInstance(ctx).updatePartial(Clc, sel);
			}
		} catch (EASBizException e) {
			e.printStackTrace();
		}
		return super._Audit(ctx, Audit);
	}

	protected boolean _UnAudit(Context ctx, String UnAudit) throws BOSException {
		try {
			UnProjectCosInfo Clc = UnProjectCosFactory.getLocalInstance(ctx).getUnProjectCosInfo(new ObjectUuidPK(UnAudit));
			if(Clc.getDjstage().equals(SfshEnum.yes)){
			Clc.setAuditor(SysContext.getSysContext().getCurrentUserInfo());
			Clc.setDjstage(SfshEnum.save);
			SelectorItemCollection sel = new SelectorItemCollection();
		    sel.add("djstage");
		    UnProjectCosFactory.getLocalInstance(ctx).updatePartial(Clc, sel);
			}
		} catch (EASBizException e) {
			e.printStackTrace();
		}
		return super._UnAudit(ctx, UnAudit);
	}
}